A = rand(16);

[X,Y]=meshgrid(linspace(-1,1,size(A,2)),linspace(-1,1,size(A,1)));
fh = figure;

for i=1:100
    if 1
        B = imfilter(A, fspecial('gaussian', [5,5], 2.5));
    else
        B = A;
    end

    set(0,'CurrentFigure',fh);
    imshow(~imdilate(bwmorph(~(0.5 > interp2(max(0,1-max(X.^4,Y.^4)).*B, 4, 'lanczos3')), 'thin', Inf), strel('disk',4)));
    pause(0.1);

    if 0
        A = min(1, max(0, A + 0.25.*(rand(size(A)) - 0.5)));
    else
        A = A(:,[2:end,1]);
    end
end
